package com.sea.supply.mapper;

import com.sea.supply.entity.ProduceDetail;
import com.sea.supply.entity.Receive;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *  接收单接口
 * @author 陈鸿飞
 * <br/>
 */
public interface ReceiveMapper {


    /**
     * 新增
     * @param receive
     * @return
     */
    int insert(Receive receive);

    /**
     * 查找指定
     * @param receive
     * @return
     */
    List<Receive> findByCnd(Receive receive);

    /**
     * 待收货列表
     * @param receive
     * @return
     */
    List<Receive> findByShipped(Receive receive);

    /**
     * 查询可分配数量
     * @param orderSku
     * @param orderChannelName
     * @return
     */
    Integer getDistributeNumber(@Param("orderSku")String orderSku,
                            @Param("orderChannelName")String orderChannelName,
                            @Param("orderDate")String orderDate,
                            @Param("producePo")String producePo);

    /**
     * 根据交期查看质检报告
     * @return
     */
    List<Receive> findByOrderDate();

    List<Receive> findByOrderDateDetail(@Param("orderDate")String orderDate);
    /**
     * 根据供应商查看质检报告
     * @return
     */
    List<Receive> findBySupplier();

    List<Receive> findBySupplierDetail(@Param("produceSupplierName")String produceSupplierName);
    /**
     * 查询可分配预占有数量数量
     * @param orderSku
     * @param orderChannelName
     * @return
     */
    List<Receive> findByDistributeReadyUse(@Param("orderSku")String orderSku,
                                           @Param("orderChannelName")String orderChannelName,
                                           @Param("orderDate")String orderDate,
                                           @Param("supplierName")String supplierName,
                                           @Param("produceNo")String produceNo);

    Receive findByWareProduce(@Param("receiveSku")String receiveSku, @Param("receiveChannelName")String receiveChannelName, @Param("produceNo")String produceNo);

    List<Receive> findReceivePlanNo();

    Receive findByWareProducePrice(@Param("receiveSku")String receiveSku, @Param("receiveChannelName")String receiveChannelName, @Param("produceNo")String produceNo);

    List<Receive> findByPlanNo(String receivePlanNo);

}